Devices, such as pumps or manual pens, used for delivering substances, such as drugs or insulin, from a local reservoir into the body of a patient are prone to problems that may impede the intended delivery rate of the substance. Such problems may include clogging, mechanical sticking, or misidentification of the administered substance. It is thus desirable that the source of the delivered substance be positively identified by the delivery device, that the proper loading of the substance reservoir be verified, that the instantaneous volume of substance in the reservoir be ascertainable, and that both the rate of delivery and the precise volume of remaining liquid be accurately monitored. Prior use of an optical monitor for similar applications, such as described in U.S. Pat. No. 4,498,843 to Schneider, et al., has been limited to measurement of delivery rate. It is, furthermore, desirable that the aforesaid functions be provided both accurately and cost effectively.